/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */
package com.uccart_project.model;

import java.io.Serializable;
import javax.persistence.Basic;
import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.GeneratedValue;
import javax.persistence.GenerationType;
import javax.persistence.Id;
import javax.persistence.JoinColumn;
import javax.persistence.ManyToOne;
import javax.persistence.NamedQueries;
import javax.persistence.NamedQuery;
import javax.persistence.Table;
import javax.xml.bind.annotation.XmlRootElement;


@Entity
@Table(name = "padron")
@XmlRootElement
@NamedQueries({
    @NamedQuery(name = "Padron.findAll", query = "SELECT p FROM Padron p"),
    @NamedQuery(name = "Padron.findByPadSerial", query = "SELECT p FROM Padron p WHERE p.padSerial = :padSerial")})
public class Padron implements Serializable {
    private static final long serialVersionUID = 1L;
    @Id
    @GeneratedValue(strategy = GenerationType.IDENTITY)
    @Basic(optional = false)
    @Column(name = "pad_serial")
    private Integer padSerial;
    @JoinColumn(name = "pad_idestudiante", referencedColumnName = "est_id")
    @ManyToOne(optional = false)
    private Estudiante padIdestudiante;
    @JoinColumn(name = "pad_codcarr", referencedColumnName = "carr_cod")
    @ManyToOne(optional = false)
    private Carrera padCodcarr;

    public Padron() {
    }

    public Padron(Integer padSerial) {
        this.padSerial = padSerial;
    }

    public Integer getPadSerial() {
        return padSerial;
    }

    public void setPadSerial(Integer padSerial) {
        this.padSerial = padSerial;
    }

    public Estudiante getPadIdestudiante() {
        return padIdestudiante;
    }

    public void setPadIdestudiante(Estudiante padIdestudiante) {
        this.padIdestudiante = padIdestudiante;
    }

    public Carrera getPadCodcarr() {
        return padCodcarr;
    }

    public void setPadCodcarr(Carrera padCodcarr) {
        this.padCodcarr = padCodcarr;
    }

    @Override
    public int hashCode() {
        int hash = 0;
        hash += (padSerial != null ? padSerial.hashCode() : 0);
        return hash;
    }

    @Override
    public boolean equals(Object object) {
        // TODO: Warning - this method won't work in the case the id fields are not set
        if (!(object instanceof Padron)) {
            return false;
        }
        Padron other = (Padron) object;
        if ((this.padSerial == null && other.padSerial != null) || (this.padSerial != null && !this.padSerial.equals(other.padSerial))) {
            return false;
        }
        return true;
    }

    @Override
    public String toString() {
        return "com.uccart_project.model.Padron[ padSerial=" + padSerial + " ]";
    }
    
}
